package org.demo.zh;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

@Component("teacher")   //扫描器自动注入
//@Repository
//@Service
public class Teacher {
    private String name;
    private String[] courses;

    public Teacher(String name, String[] courses) {
        this.name = name;
        this.courses = courses;
    }

    public Teacher() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String[] getCourses() {
        return courses;
    }

    public void setCourses(String[] courses) {
        this.courses = courses;
    }

    public void Teach(){
        System.out.println("老师正在上课...");
    }
}
